home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form XView
- BackColor = &H00C0C0C0&
- BorderStyle = 1 'Fixed Single
- Caption = "CyberSpace Cruiser"
- ClientHeight = 7005
- ClientLeft = 1050
- ClientTop = 1770
- ClientWidth = 8670
- Height = 7695
- Icon = CSC5.FRX:0000
- Left = 990
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- MaxButton = 0 'False
- ScaleHeight = 7005
- ScaleMode = 0 'User
- ScaleTop = 500
- ScaleWidth = 8670
- Top = 1140
- Width = 8790
- Begin CommandButton MinusButton
- Caption = "-1"
- Height = 255
- Left = 5880
- TabIndex = 20
- Top = 6600
- Visible = 0 'False
- Width = 495
- End
- Begin CommandButton PlusButton
- Caption = "+1"
- Height = 255
- Left = 5880
- TabIndex = 19
- Top = 6360
- Visible = 0 'False
- Width = 495
- End
- Begin PictureBox Picture3
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 495
- Left = 720
- ScaleHeight = 495
- ScaleWidth = 5055
- TabIndex = 6
- Top = 6360
- Width = 5055
- Begin HScrollBar PanLRScroll
- Height = 255
- LargeChange = 10
- Left = 120
- Max = 181
- Min = -181
- TabIndex = 9
- Top = 120
- Width = 4815
- End
- End
- Begin CommandButton AFButton
- Caption = "AF"
- Height = 495
- Left = 120
- TabIndex = 21
- Top = 6360
- Visible = 0 'False
- Width = 495
- End
- Begin CheckBox SCCheck
- BackColor = &H00C0C0C0&
- Caption = "Spin the cube"
- ForeColor = &H00808080&
- Height = 255
- Left = 6600
- TabIndex = 22
- Top = 3960
- Width = 1815
- End
- Begin PictureBox Picture5
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 1935
- Left = 6480
- ScaleHeight = 1935
- ScaleWidth = 2055
- TabIndex = 11
- Top = 1800
- Width = 2055
- Begin Label Label5
- BackColor = &H00C0C0C0&
- Caption = "Label5"
- ForeColor = &H00808080&
- Height = 255
- Left = 120
- TabIndex = 16
- Top = 1560
- Width = 1815
- End
- Begin Label Label4
- BackColor = &H00C0C0C0&
- Caption = "Label4"
- ForeColor = &H00808080&
- Height = 255
- Left = 120
- TabIndex = 15
- Top = 1200
- Width = 1815
- End
- Begin Label Label3
- BackColor = &H00C0C0C0&
- Caption = "Label3"
- ForeColor = &H00808080&
- Height = 255
- Left = 120
- TabIndex = 14
- Top = 840
- Width = 1815
- End
- Begin Label Label2
- BackColor = &H00C0C0C0&
- Caption = "Label2"
- ForeColor = &H00808080&
- Height = 255
- Left = 120
- TabIndex = 13
- Top = 480
- Width = 1815
- End
- Begin Label Label1
- BackColor = &H00C0C0C0&
- Caption = "Label1"
- ForeColor = &H00808080&
- Height = 255
- Left = 120
- TabIndex = 12
- Top = 120
- Width = 1815
- End
- End
- Begin PictureBox Picture4
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 5055
- Left = 5880
- ScaleHeight = 5055
- ScaleWidth = 495
- TabIndex = 7
- Top = 1200
- Width = 495
- Begin VScrollBar BackForScroll
- Height = 4815
- LargeChange = 100
- Left = 120
- Max = 5000
- Min = -5000
- SmallChange = 10
- TabIndex = 8
- Top = 120
- Width = 255
- End
- End
- Begin PictureBox ViewPic
- AutoRedraw = -1 'True
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 5055
- Left = 720
- ScaleHeight = 337
- ScaleMode = 3 'Pixel
- ScaleWidth = 337
- TabIndex = 0
- Top = 1200
- Width = 5055
- End
- Begin PictureBox Picture1
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 5055
- Left = 120
- ScaleHeight = 5055
- ScaleWidth = 495
- TabIndex = 5
- Top = 1200
- Width = 495
- Begin VScrollBar PanUDScroll
- Height = 4815
- LargeChange = 10
- Left = 120
- Max = 90
- Min = -90
- TabIndex = 10
- Top = 120
- Width = 255
- End
- End
- Begin PictureBox Picture2
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 1575
- Left = 6480
- ScaleHeight = 1575
- ScaleWidth = 2055
- TabIndex = 1
- Top = 120
- Width = 2055
- Begin CommandButton ExitButton
- Caption = "Exit"
- Height = 375
- Left = 120
- TabIndex = 2
- Top = 1080
- Width = 1815
- End
- Begin CommandButton StopButton
- Caption = "Spare"
- Enabled = 0 'False
- Height = 375
- Left = 120
- TabIndex = 3
- Top = 600
- Width = 1815
- End
- Begin CommandButton RunButton
- Caption = "Spare"
- Enabled = 0 'False
- Height = 375
- Left = 120
- TabIndex = 4
- Top = 120
- Width = 1815
- End
- End
- Begin PictureBox Picture7
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 975
- Left = 120
- ScaleHeight = 975
- ScaleWidth = 6255
- TabIndex = 17
- Top = 120
- Width = 6255
- Begin TextBox CommText
- BackColor = &H00808080&
- BorderStyle = 0 'None
- ForeColor = &H00FFFF00&
- Height = 735
- Left = 120
- MultiLine = -1 'True
- TabIndex = 18
- Top = 120
- Width = 6015
- End
- End
- Begin Menu MenuFile
- Caption = "&File"
- Begin Menu FileExit
- Caption = "E&xit"
- End
- End
- Begin Menu MenuAction
- Caption = "&Action"
- Begin Menu ActionJump
- Caption = "&Jump to Coordinate"
- Begin Menu JumpAbsolute
- Caption = "&Absolute"
- Begin Menu AbsoluteX
- Caption = "&X"
- End
- Begin Menu AbsoluteY
- Caption = "&Y"
- End
- Begin Menu AbsoluteZ
- Caption = "&Z"
- End
- End
- Begin Menu JumpRelative
- Caption = "&Relative"
- Begin Menu RelativeX
- Caption = "&X"
- End
- Begin Menu RelativeY
- Caption = "&Y"
- End
- Begin Menu RelativeZ
- Caption = "&Z"
- End
- End
- End
- End
- Begin Menu MenuView
- Caption = "&View"
- Begin Menu ViewFine
- Caption = "&Fine Position Controls"
- End
- Begin Menu ViewAboutFace
- Caption = "&About Face Button"
- End
- End
- Begin Menu MenuHelp
- Caption = "&Help"
- Begin Menu HelpUsing
- Caption = "&Using CyberSpace Cruiser"
- End
- Begin Menu HelpViewport
- Caption = "The &Viewport"
- End
- Begin Menu HelpHyphen1
- Caption = "-"
- End
- Begin Menu HelpAbout
- Caption = "&About CyberSpace Cruiser"
- End
- End
- '3D CyberSpace viewer from...
- 'Ivory Tower Software
- 'Richard Wagner
- 'CIS 76427,2611
- 'Copyright 1992, all rights reserved.
- 'You may use this VB source code in your programs if you include attribution in your
- 'startup and "about" screens in the form: "Portions of this program copyright by
- 'Ivory Tower Software, used with permission," or a similar phrase.
- 'If you do use this source code in your application, please let us know. We would like to
- 'take a look at it. Your comments and suggestions for improving this software are
- 'welcome.
- Dim crlf As String 'Carriage return linefeed combination
- Dim sfAzimuth As Single 'View direction, vertical axis, single floating point
- Dim sfElevation As Single 'View direction, horizontal axis
- Dim iOldLRAngle As Integer 'Previous LR angle in degrees, integer
- Dim iOldUDAngle As Integer 'Previous UD angle in degrees
- Dim sfMDownX As Single 'Mouse down X for PicView double click event
- Dim sfMDownY As Single 'Mouse down Y for PicView double click event
- Sub AbsoluteX_Click ()
- LocOK% = -1
- msg$ = "What is the X coordinate to jump to:"
- Result$ = InputBox$(msg$, "Absolute X Coordinate", Str$(sfViewPointX))
- If Result$ = "" Then Exit Sub
- Delta! = Val(Result$) - sfViewPointX
- sfViewPointX = Val(Result$)
- sfWinPointX = sfWinPointX + Delta!
- sfRPointX = sfRPointX + Delta!
- sfSPointX = sfSPointX + Delta!
- LocationModes 0, LocOK%
- If LocOK% = 86 Then 'Trying to jump to a forbidden zone
- sfViewPointX = sfViewPointX - Delta!
- sfWinPointX = sfWinPointX - Delta!
- sfRPointX = sfRPointX - Delta!
- sfSPointX = sfSPointX - Delta!
- Exit Sub
- End If
- Label1.caption = " X = " + Format$(sfViewPointX, "####0")
- PlaceAllObjects
- End Sub
- Sub AbsoluteY_Click ()
- LocOK% = -1
- msg$ = "What is the Y coordinate to jump to:"
- Result$ = InputBox$(msg$, "Absolute Y Coordinate", Str$(sfViewPointY))
- If Result$ = "" Then Exit Sub
- Delta! = Val(Result$) - sfViewPointY
- sfViewPointY = Val(Result$)
- sfWinPointY = sfWinPointY + Delta!
- sfRPointY = sfRPointY + Delta!
- sfSPointY = sfSPointY + Delta!
- LocationModes 0, LocOK%
- If LocOK% = 86 Then 'Trying to jump to a forbidden zone
- sfViewPointY = sfViewPointY - Delta!
- sfWinPointY = sfWinPointY - Delta!
- sfRPointY = sfRPointY - Delta!
- sfSPointY = sfSPointY - Delta!
- Exit Sub
- End If
- Label1.caption = " Y = " + Format$(sfViewPointY, "####0")
- PlaceAllObjects
- End Sub
- Sub AbsoluteZ_Click ()
- LocOK% = -1
- msg$ = "What is the Z coordinate to jump to:"
- Result$ = InputBox$(msg$, "Absolute Z Coordinate", Str$(sfViewPointZ))
- If Result$ = "" Then Exit Sub
- Delta! = Val(Result$) - sfViewPointZ
- sfViewPointZ = Val(Result$)
- sfWinPointZ = sfWinPointZ + Delta!
- sfRPointZ = sfRPointZ + Delta!
- sfSPointZ = sfSPointZ + Delta!
- LocationModes 0, LocOK%
- If LocOK% = 86 Then 'Trying to jump to a forbidden zone
- sfViewPointZ = sfViewPointZ - Delta!
- sfWinPointZ = sfWinPointZ - Delta!
- sfRPointZ = sfRPointZ - Delta!
- sfSPointZ = sfSPointZ - Delta!
- Exit Sub
- End If
- Label1.caption = " Z = " + Format$(sfViewPointZ, "####0")
- PlaceAllObjects
- End Sub
- Sub AFButton_Click ()
- TempVert% = -PanUDScroll.value
- PanUDScroll.value = TempVert%
- TempHort% = PanLRScroll.value
- TempHort% = TempHort% + 180
- If TempHort% > 180 Then TempHort% = TempHort% - 360
- PanLRScroll.value = TempHort%
- End Sub
- Sub BackForScroll_Change ()
- 'On Error GoTo BFScrollHandler
- Static iOldScroll As Integer
- Static iReWind As Integer
- If iReWind Then
- iReWind = 0
- Exit Sub
- End If
- If iFlatLined Then Exit Sub
- DeltaLine% = iOldScroll - BackForScroll.value
- DeltaX! = Sin(sfAzimuth) * Cos(sfElevation) * DeltaLine%
- DeltaY! = Sin(sfElevation) * DeltaLine%
- DeltaZ! = Cos(sfAzimuth) * Cos(sfElevation) * DeltaLine%
- sfViewPointX = sfViewPointX + DeltaX!
- sfViewPointY = sfViewPointY + DeltaY!
- sfViewPointZ = sfViewPointZ - DeltaZ!
- sfWinPointX = sfWinPointX + DeltaX!
- sfWinPointY = sfWinPointY + DeltaY!
- sfWinPointZ = sfWinPointZ - DeltaZ!
- sfRPointX = sfRPointX + DeltaX!
- sfRPointY = sfRPointY + DeltaY!
- sfRPointZ = sfRPointZ - DeltaZ!
- sfSPointX = sfSPointX + DeltaX!
- sfSPointY = sfSPointY + DeltaY!
- sfSPointZ = sfSPointZ - DeltaZ!
- Label1.caption = " X = " + Format$(sfViewPointX, "####0")
- Label2.caption = " Y = " + Format$(sfViewPointY, "####0")
- Label3.caption = " Z = " + Format$(sfViewPointZ, "####0")
- If BackForScroll.value = 5000 Or BackForScroll.value = -5000 Then
- iReWind = -1
- BackForScroll.value = 0
- End If
- iOldScroll = BackForScroll.value
- LocationModes DeltaLine%, 0
- PlaceAllObjects
- ViewPic.SetFocus
- BFScrollResume:
- Exit Sub
- BFScrollHandler:
- MsgBox "Error in BackForScroll: " + Error$
- Resume BFScrollResume
- End Sub
- Sub BigRedCube ()
- 'This sub defines the object-primitives for the Big Red Cube in cyberspace.
- 'Each object is defined in its own object-space centered on 0, 0, 0.
- 'A nominal object in has a size of 100 cyberspace linear units (CLUs).
- 'The cube is an assemblage of filled squares, each 10 times bigger than nominal.
- i% = iNumObjects
- i% = i% + 1
- iObjectType(i%) = 13 'Filled Square XY
- iLocationX(i%) = -4000
- iLocationY(i%) = -1000
- iLocationZ(i%) = 12000 + 500
- iColor(i%) = 4 'Fill color, edges will be black
- sfSize(i%) = 10 '10 times nominal
- i% = i% + 1
- iObjectType(i%) = 13
- iLocationX(i%) = -4000
- iLocationY(i%) = -1000
- iLocationZ(i%) = 12000 - 500
- iColor(i%) = 4
- sfSize(i%) = 10
- i% = i% + 1
- iObjectType(i%) = 14
- iLocationX(i%) = -4000 + 500
- iLocationY(i%) = -1000
- iLocationZ(i%) = 12000
- iColor(i%) = 4
- sfSize(i%) = 10
- i% = i% + 1
- iObjectType(i%) = 14
- iLocationX(i%) = -4000 - 500
- iLocationY(i%) = -1000
- iLocationZ(i%) = 12000
- iColor(i%) = 4
- sfSize(i%) = 10
- i% = i% + 1
- iObjectType(i%) = 15
- iLocationX(i%) = -4000
- iLocationY(i%) = -1000 + 500
- iLocationZ(i%) = 12000
- iColor(i%) = 4
- sfSize(i%) = 10
- i% = i% + 1
- iObjectType(i%) = 15
- iLocationX(i%) = -4000
- iLocationY(i%) = -1000 - 500
- iLocationZ(i%) = 12000
- iColor(i%) = 4
- sfSize(i%) = 10
- iNumObjects = i%
- End Sub
- Sub DefineAllObjects ()
- 'Each object in cyberspace is defined by:
- 'Object Number
- 'Object Type
- 'Center X
- 'Center Y
- 'Center Z
- 'qbcolor
- 'sfSize Factor
- 'iNumObjects = total number of objects in cyberspace
- iNumObjects = 0
- BigRedCube 'The big red cube
- YellowCluster 'A cluster of 100 random points
- IvoryTower 'A tall white structure
- Pyramids 'Mysterious solids in cyberspace
- SpinningCube 'An animated wireframe object
- End Sub
- Sub ExitButton_Click ()
- End
- End Sub
- Sub FileExit_Click ()
- End
- End Sub
- Sub Form_Load ()
- 'left = 0
- left = (Screen.width - width) / 2
- top = (Screen.height - height) / 2
- crlf = Chr$(13) + Chr$(10)
- ViewPic.AutoRedraw = -1
- ViewPic.fillstyle = 0
- ViewPic.ScaleWidth = 1000
- ViewPic.ScaleHeight = -1000
- ViewPic.ScaleTop = 500
- ViewPic.scaleleft = -500
- sfViewPointX = 0
- sfViewPointY = 0
- sfViewPointZ = 5000
- sfWinPointX = 0
- sfWinPointY = 0
- sfWinPointZ = sfViewPointZ - 1000
- sfRPointX = 500
- sfRPointY = 0
- sfRPointZ = sfViewPointZ - 1000
- sfSPointX = 0
- sfSPointY = 500
- sfSPointZ = sfViewPointZ - 1000
- sfAzimuth = 0
- sfElevation = 0
- lOldLinPos = 5000
- lNewLinPos = 5000
- Label1.caption = " X =" + Str$(sfViewPointX)
- Label2.caption = " Y =" + Str$(sfViewPointY)
- Label3.caption = " Z =" + Str$(sfViewPointZ)
- Label4.caption = " Azimuth = 0"
- Label5.caption = " Inclination = 0"
- MakeObjects
- DefineAllObjects
- PlaceAllObjects
- msg$ = "Welcome to cyberspace. Some pyramids are straight ahead."
- msg$ = msg$ + " Use the vertical scroll bar to the right of the viewport"
- msg$ = msg$ + " to move forward."
- CommText.text = msg$
- End Sub
- Sub Form_Paint ()
- BorderBoxRaised ViewPic, XView
- BorderBoxRaised Picture1, XView
- BorderBoxRaised Picture2, XView
- BorderBoxRaised Picture3, XView
- BorderBoxRaised Picture4, XView
- BorderBoxRaised Picture5, XView
- BorderBoxRaised Picture7, XView
- PicBorderBoxRecessed CommText, Picture7
- End Sub
- Sub Form_Unload (Cancel As Integer)
- 'This is necessary in this program: applications with multiple forms need to
- 'have "end" in the Unload procedure of their main forms. This gets around a VB
- 'bug which can either leave orphan hidden forms in memory, or crash Windows
- 'if you try to exit windows and unload forms from the main form on Windows close.
- End
- End Sub
- Sub HelpAbout_Click ()
- msg$ = "CyberSpace Cruiser demo version 1.09, July 17, 1992" + crlf + crlf
- msg$ = msg$ + "Copyright 1992 by Ivory Tower Software, all rights reserved." + crlf + crlf
- msg$ = msg$ + "Cyberspace is a real cartesian space of infinite extent, and"
- msg$ = msg$ + " was first described in the novels of William Gibson."
- msg$ = msg$ + " Now Ivory Tower's CyberSpace Cruiser lets any Microsoft Windows computer"
- msg$ = msg$ + " user 'jack in' to cyberspace. A fast machine is highly recommended." + crlf + crlf
- msg$ = msg$ + "This program is freeware. You may copy it freely and anyone may run it at"
- msg$ = msg$ + " no cost on any machine."
- msg$ = msg$ + crlf + crlf
- msg$ = msg$ + "Your comments and suggestions are welcome. Contact Ivory Tower Software"
- msg$ = msg$ + " via CompuServe mail 76427,2611."
- MsgBox msg$, 0, "About CyberSpace Cruiser"
- End Sub
- Sub HelpUsing_Click ()
- msg$ = "CyberSpace Cruiser allows a human being to view and maneuver through cyberspace."
- msg$ = msg$ + " The viewport gives a 51 degree view angle forward. The scrollbar"
- msg$ = msg$ + " to the right of the viewport moves the user's view point forward and"
- msg$ = msg$ + " backward through cyberspace. Move the thumb button up to go forward."
- msg$ = msg$ + " Each click on the scroll arrow moves the view point 10 cyberspace linear"
- msg$ = msg$ + " units (CLUs). Each click in the scrollbar itself moves the view point 100"
- msg$ = msg$ + " CLUs. The user's position in cyberspace is displayed at all times just"
- msg$ = msg$ + " below the 'Exit' button." + crlf + crlf
- msg$ = msg$ + " The scrollbar at the botton of the viewport controls the user's"
- msg$ = msg$ + " view azimuth (pans left and right) and the scrollbar to the left of the"
- msg$ = msg$ + " viewport controls the user's view inclination (pans up and down). The"
- msg$ = msg$ + " view angles move in one and ten degree increments." + crlf + crlf
- msg$ = msg$ + " To travel in cyberspace, adjust the view direction until the destination"
- msg$ = msg$ + " point is near the center of the viewport. Then move forward until the"
- msg$ = msg$ + " point is reached." + crlf + crlf
- msg$ = msg$ + " 'CyberSpace Cruiser' is a trademark of Ivory Tower Software."
- MsgBox msg$, 0, "Using CyberSpace Cruiser"
- End Sub
- Sub HelpViewport_Click ()
- msg$ = "The viewport is the large square region of the CyberSpace Cruiser window"
- msg$ = msg$ + " and provides your view into cyberspace. The viewport gives a viewing"
- msg$ = msg$ + " angle of 51 degrees both horizontally and vertically. The viewing"
- msg$ = msg$ + " direction is controlled with the horizontal scroll bar below"
- msg$ = msg$ + " the viewport and with the vertical scroll bar to the left of the"
- msg$ = msg$ + " viewport." + crlf + crlf
- msg$ = msg$ + "If you double click on any point on the viewport, your"
- msg$ = msg$ + " view direction will automatically be adjusted to bring that point"
- msg$ = msg$ + " into the center of the viewport."
- MsgBox msg$, 0, "The Viewport"
- End Sub
- Sub IvoryTower ()
- 'This sub creates the white tower object-set:
- i% = iNumObjects
- 'Base Cube:
- i% = i% + 1
- iObjectType(i%) = 13 'Filled Square XY
- iLocationX(i%) = 9000
- iLocationY(i%) = -1000
- iLocationZ(i%) = 9000 + 500
- iColor(i%) = 15
- sfSize(i%) = 10
- i% = i% + 1
- iObjectType(i%) = 13 'Filled Square XY
- iLocationX(i%) = 9000
- iLocationY(i%) = -1000
- iLocationZ(i%) = 9000 - 500
- iColor(i%) = 15
- sfSize(i%) = 10
- i% = i% + 1
- iObjectType(i%) = 14 'Filled Square YZ
- iLocationX(i%) = 9000 + 500
- iLocationY(i%) = -1000
- iLocationZ(i%) = 9000
- iColor(i%) = 15
- sfSize(i%) = 10
- i% = i% + 1
- iObjectType(i%) = 14 'Filled Square YZ
- iLocationX(i%) = 9000 - 500
- iLocationY(i%) = -1000
- iLocationZ(i%) = 9000
- iColor(i%) = 15
- sfSize(i%) = 10
- i% = i% + 1
- iObjectType(i%) = 15 'Filled Square XZ
- iLocationX(i%) = 9000
- iLocationY(i%) = -1000 + 500
- iLocationZ(i%) = 9000
- iColor(i%) = 15
- sfSize(i%) = 10
- i% = i% + 1
- iObjectType(i%) = 15 'Filled Square XZ
- iLocationX(i%) = 9000
- iLocationY(i%) = -1000 - 500
- iLocationZ(i%) = 9000
- iColor(i%) = 15
- sfSize(i%) = 10
- 'Second story:
- i% = i% + 1
- iObjectType(i%) = 16 'Tall Rectangle XY
- iLocationX(i%) = 9000
- iLocationY(i%) = 0
- iLocationZ(i%) = 9000 + 400
- iColor(i%) = 15
- sfSize(i%) = 10
- iNumObjects = i%
- i% = i% + 1
- iObjectType(i%) = 16 'Tall Rectangle XY
- iLocationX(i%) = 9000
- iLocationY(i%) = 0
- iLocationZ(i%) = 9000 - 400
- iColor(i%) = 15
- sfSize(i%) = 10
- i% = i% + 1
- iObjectType(i%) = 17 'Tall Rectangle YZ
- iLocationX(i%) = 9000 + 400
- iLocationY(i%) = 0
- iLocationZ(i%) = 9000
- iColor(i%) = 15
- sfSize(i%) = 10
- i% = i% + 1
- iObjectType(i%) = 17 'Tall Rectangle YZ
- iLocationX(i%) = 9000 - 400
- iLocationY(i%) = 0
- iLocationZ(i%) = 9000
- iColor(i%) = 15
- sfSize(i%) = 10
- i% = i% + 1
- iObjectType(i%) = 15 'Filled Square XZ
- iLocationX(i%) = 9000
- iLocationY(i%) = 500
- iLocationZ(i%) = 9000
- iColor(i%) = 15
- sfSize(i%) = 8
- 'Third story:
- i% = i% + 1
- iObjectType(i%) = 18 'Tall Rectangle XY
- iLocationX(i%) = 9000
- iLocationY(i%) = 1000
- iLocationZ(i%) = 9000 + 300
- iColor(i%) = 15
- sfSize(i%) = 10
- iNumObjects = i%
- i% = i% + 1
- iObjectType(i%) = 18 'Tall Rectangle XY
- iLocationX(i%) = 9000
- iLocationY(i%) = 1000
- iLocationZ(i%) = 9000 - 300
- iColor(i%) = 15
- sfSize(i%) = 10
- i% = i% + 1
- iObjectType(i%) = 19 'Tall Rectangle YZ
- iLocationX(i%) = 9000 + 300
- iLocationY(i%) = 1000
- iLocationZ(i%) = 9000
- iColor(i%) = 15
- sfSize(i%) = 10
- i% = i% + 1
- iObjectType(i%) = 19 'Tall Rectangle YZ
- iLocationX(i%) = 9000 - 300
- iLocationY(i%) = 1000
- iLocationZ(i%) = 9000
- iColor(i%) = 15
- sfSize(i%) = 10
- i% = i% + 1
- iObjectType(i%) = 15 'Filled Square XZ
- iLocationX(i%) = 9000
- iLocationY(i%) = 1500
- iLocationZ(i%) = 9000
- iColor(i%) = 15
- sfSize(i%) = 6
- iNumObjects = i%
- End Sub
- Sub LocationModes (ByVal iJump As Integer, iLocOK As Integer)
- 'Depending on where you are in cyberspace, different events can occur...
- CommText.text = ""
- 'Big Red Cube:
- If sfViewPointZ > 11000 - 2000 And sfViewPointZ < 13000 + 2000 Then
- If sfViewPointX < -3000 + 2000 And sfViewPointX > -5000 - 2000 Then
- If sfViewPointY < 2000 And sfViewPointY > -2000 - 2000 Then
- msg$ = "The big red cube is rumored to contain a fabulous wealth"
- msg$ = msg$ + " of software and data."
- CommText.text = msg$
- If sfViewPointZ > 11000 - 500 And sfViewPointZ < 13000 + 500 Then
- If sfViewPointX < -3000 + 500 And sfViewPointX > -5000 - 500 Then
- If sfViewPointY < 500 And sfViewPointY > -2000 - 500 Then
- MsgBox "Entry to this space is prohibited."
- If Not iLocOK Then
- XView.BackForScroll.value = XView.BackForScroll.value + iJump
- Else
- iLocOK = 86
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- 'Ivory Tower:
- If sfViewPointZ > 8000 - 2000 And sfViewPointZ < 10000 + 2000 Then
- If sfViewPointX > 8000 - 2000 And sfViewPointX < 10000 + 2000 Then
- If sfViewPointY < 2000 + 2000 And sfViewPointY > -2000 - 2000 Then
- msg$ = "The tall white structure is one of the largest objects"
- msg$ = msg$ + " in cyberspace, measuring 3000 CLUs high."
- CommText.text = msg$
- If sfViewPointZ > 8000 - 500 And sfViewPointZ < 10000 + 500 Then
- If sfViewPointX > 8000 - 500 And sfViewPointX < 10000 + 500 Then
- If sfViewPointY < 2000 + 500 And sfViewPointY > -2000 - 500 Then
- MsgBox "Entry to this space is prohibited."
- If Not iLocOK Then
- XView.BackForScroll.value = XView.BackForScroll.value + iJump
- Else
- iLocOK = 86
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- 'Pyramids:
- If sfViewPointZ < 200 - 500 + 500 And sfViewPointZ > -400 - 500 - 500 Then
- If sfViewPointX > -300 - 500 And sfViewPointX < 200 + 500 Then
- If sfViewPointY < 200 + 500 And sfViewPointY > -200 - 500 Then
- msg$ = "The two pyramids are rather small structures in cyberspace,"
- msg$ = msg$ + " the taller one being only 50 CLUs high."
- msg$ = msg$ + " No one has ever been able to enter them, so no one knows what's"
- msg$ = msg$ + " inside them, or who they belong to."
- CommText.text = msg$
- If sfViewPointZ < 200 - 500 And sfViewPointZ > -400 - 500 Then
- If sfViewPointX > -300 And sfViewPointX < 200 Then
- If sfViewPointY < 200 And sfViewPointY > -200 Then
- MsgBox "Entry to this space is prohibited."
- If Not iLocOK Then
- XView.BackForScroll.value = XView.BackForScroll.value + iJump
- Else
- iLocOK = 86
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End Sub
- Sub MakeObjects ()
- 'Make prototype objects.
- 'Coordinates are in object space. Center objects about 0,0,0 in object space.
- 'Object sfSizes, locations and iColors are assigned in DefineAllObjects.
- 'The nominal size of an object is 100 CLUs in its major dimension.
- 'These object-primitives are defined about 0, 0, 0 in their own object-spaces.
- 'They are later translated to cyberspace as needed, each being called by its
- 'object type:
- 'Object type 0, Point:
- iNumPoints(0) = 1
- iObjectX(0, 1) = 0
- iObjectY(0, 1) = 0
- iObjectZ(0, 1) = 0
- 'Object type 1, Wireframe Cube:
- iNumPoints(1) = 8
- 'Vertex 1:
- iObjectX(1, 1) = 50
- iObjectY(1, 1) = 50
- iObjectZ(1, 1) = -50
- 'Vertex 2:
- iObjectX(1, 2) = -50
- iObjectY(1, 2) = 50
- iObjectZ(1, 2) = -50
- 'Vertex 3:
- iObjectX(1, 3) = -50
- iObjectY(1, 3) = -50
- iObjectZ(1, 3) = -50
- 'Vertex 4:
- iObjectX(1, 4) = 50
- iObjectY(1, 4) = -50
- iObjectZ(1, 4) = -50
- 'Vertex 5:
- iObjectX(1, 5) = 50
- iObjectY(1, 5) = 50
- iObjectZ(1, 5) = 50
- 'Vertex 6:
- iObjectX(1, 6) = -50
- iObjectY(1, 6) = 50
- iObjectZ(1, 6) = 50
- 'Vertex 7:
- iObjectX(1, 7) = -50
- iObjectY(1, 7) = -50
- iObjectZ(1, 7) = 50
- 'Vertex 8:
- iObjectX(1, 8) = 50
- iObjectY(1, 8) = -50
- iObjectZ(1, 8) = 50
- 'Object type 13, Filled Square in XY plane
- iNumPoints(13) = 4
- iObjectX(13, 1) = 50
- iObjectY(13, 1) = 50
- iObjectZ(13, 1) = 0
- iObjectX(13, 2) = -50
- iObjectY(13, 2) = 50
- iObjectZ(13, 2) = 0
- iObjectX(13, 3) = -50
- iObjectY(13, 3) = -50
- iObjectZ(13, 3) = 0
- iObjectX(13, 4) = 50
- iObjectY(13, 4) = -50
- iObjectZ(13, 4) = 0
- 'Object type 14, Filled Square YZ
- iNumPoints(14) = 4
- iObjectX(14, 1) = 0
- iObjectY(14, 1) = 50
- iObjectZ(14, 1) = 50
- iObjectX(14, 2) = 0
- iObjectY(14, 2) = 50
- iObjectZ(14, 2) = -50
- iObjectX(14, 3) = 0
- iObjectY(14, 3) = -50
- iObjectZ(14, 3) = -50
- iObjectX(14, 4) = 0
- iObjectY(14, 4) = -50
- iObjectZ(14, 4) = 50
- 'Object type 15, Filled Square XZ
- iNumPoints(15) = 4
- iObjectX(15, 1) = 50
- iObjectY(15, 1) = 0
- iObjectZ(15, 1) = 50
- iObjectX(15, 2) = 50
- iObjectY(15, 2) = 0
- iObjectZ(15, 2) = -50
- iObjectX(15, 3) = -50
- iObjectY(15, 3) = 0
- iObjectZ(15, 3) = -50
- iObjectX(15, 4) = -50
- iObjectY(15, 4) = 0
- iObjectZ(15, 4) = 50
- 'Object type 16, Filled Tall Rectangle (80 x 100) in XY plane
- iNumPoints(16) = 4
- iObjectX(16, 1) = 40
- iObjectY(16, 1) = 50
- iObjectZ(16, 1) = 0
- iObjectX(16, 2) = -40
- iObjectY(16, 2) = 50
- iObjectZ(16, 2) = 0
- iObjectX(16, 3) = -40
- iObjectY(16, 3) = -50
- iObjectZ(16, 3) = 0
- iObjectX(16, 4) = 40
- iObjectY(16, 4) = -50
- iObjectZ(16, 4) = 0
- 'Object type 17, Filled Tall Rectangle (80 x 100) in YZ
- iNumPoints(17) = 4
- iObjectX(17, 1) = 0
- iObjectY(17, 1) = 50
- iObjectZ(17, 1) = 40
- iObjectX(17, 2) = 0
- iObjectY(17, 2) = 50
- iObjectZ(17, 2) = -40
- iObjectX(17, 3) = 0
- iObjectY(17, 3) = -50
- iObjectZ(17, 3) = -40
- iObjectX(17, 4) = 0
- iObjectY(17, 4) = -50
- iObjectZ(17, 4) = 40
- 'Object type 18, Filled Tall Rectangle (60 x 100) in XY plane
- iNumPoints(18) = 4
- iObjectX(18, 1) = 30
- iObjectY(18, 1) = 50
- iObjectZ(18, 1) = 0
- iObjectX(18, 2) = -30
- iObjectY(18, 2) = 50
- iObjectZ(18, 2) = 0
- iObjectX(18, 3) = -30
- iObjectY(18, 3) = -50
- iObjectZ(18, 3) = 0
- iObjectX(18, 4) = 30
- iObjectY(18, 4) = -50
- iObjectZ(18, 4) = 0
- 'Object type 19, Filled Tall Rectangle (60 x 100) in YZ
- iNumPoints(19) = 4
- iObjectX(19, 1) = 0
- iObjectY(19, 1) = 50
- iObjectZ(19, 1) = 30
- iObjectX(19, 2) = 0
- iObjectY(19, 2) = 50
- iObjectZ(19, 2) = -30
- iObjectX(19, 3) = 0
- iObjectY(19, 3) = -50
- iObjectZ(19, 3) = -30
- iObjectX(19, 4) = 0
- iObjectY(19, 4) = -50
- iObjectZ(19, 4) = 30
- 'Object type 22, Filled Pyramid Facet +X, +Z (shift center -x, -z)
- iNumPoints(22) = 3
- iObjectX(22, 1) = 50 - 10
- iObjectY(22, 1) = -50
- iObjectZ(22, 1) = 0 - 10
- iObjectX(22, 2) = 0 - 10
- iObjectY(22, 2) = 0
- iObjectZ(22, 2) = 0 - 10
- iObjectX(22, 3) = 0 - 10
- iObjectY(22, 3) = -50
- iObjectZ(22, 3) = 50 - 10
- 'Object type 23, Filled Pyramid Facet -X, +Z (shift center +x, -z
- iNumPoints(23) = 3
- iObjectX(23, 1) = -50 + 10
- iObjectY(23, 1) = -50
- iObjectZ(23, 1) = 0 - 10
- iObjectX(23, 2) = 0 + 10
- iObjectY(23, 2) = 0
- iObjectZ(23, 2) = 0 - 10
- iObjectX(23, 3) = 0 + 10
- iObjectY(23, 3) = -50
- iObjectZ(23, 3) = 50 - 10
- 'Object type 24, Filled Pyramid Facet -X, -Z
- iNumPoints(24) = 3
- iObjectX(24, 1) = -50 + 10
- iObjectY(24, 1) = -50
- iObjectZ(24, 1) = 0 + 10
- iObjectX(24, 2) = 0 + 10
- iObjectY(24, 2) = 0
- iObjectZ(24, 2) = 0 + 10
- iObjectX(24, 3) = 0 + 10
- iObjectY(24, 3) = -50
- iObjectZ(24, 3) = -50 + 10
- 'Object type 25, Filled Pyramid Facet +X, -Z
- iNumPoints(25) = 3
- iObjectX(25, 1) = 50 - 10
- iObjectY(25, 1) = -50
- iObjectZ(25, 1) = 0 + 10
- iObjectX(25, 2) = 0 - 10
- iObjectY(25, 2) = 0
- iObjectZ(25, 2) = 0 + 10
- iObjectX(25, 3) = 0 - 10
- iObjectY(25, 3) = -50
- iObjectZ(25, 3) = -50 + 10
- 'Object type 26, Filled Diamond XZ (pyramid base)
- iNumPoints(26) = 4
- iObjectX(26, 1) = 0
- iObjectY(26, 1) = 0
- iObjectZ(26, 1) = 50
- iObjectX(26, 2) = 50
- iObjectY(26, 2) = 0
- iObjectZ(26, 2) = 0
- iObjectX(26, 3) = 0
- iObjectY(26, 3) = 0
- iObjectZ(26, 3) = -50
- iObjectX(26, 4) = -50
- iObjectY(26, 4) = 0
- iObjectZ(26, 4) = 0
- 'Object type 43, Globular Cluster:
- Randomize
- iNumPoints(43) = 100
- For i% = 1 To 100
- Alpha! = (Rnd * 2 - 1) * sfPi
- Beta! = Rnd * sfPi
- Radius! = Rnd * 50
- iObjectX(43, i%) = CInt(Radius! * Cos(Alpha!) * Sin(Beta!))
- iObjectY(43, i%) = CInt(Radius! * Cos(Beta!))
- iObjectZ(43, i%) = CInt(Radius! * Sin(Alpha!) * Sin(Beta!))
- Next i%
- 'Object type 44, Spinning Wireframe Cube:
- iNumPoints(44) = 8
- 'Vertex 1:
- iObjectX(44, 1) = 50
- iObjectY(44, 1) = 50
- iObjectZ(44, 1) = -50
- 'Vertex 2:
- iObjectX(44, 2) = -50
- iObjectY(44, 2) = 50
- iObjectZ(44, 2) = -50
- 'Vertex 3:
- iObjectX(44, 3) = -50
- iObjectY(44, 3) = -50
- iObjectZ(44, 3) = -50
- 'Vertex 4:
- iObjectX(44, 4) = 50
- iObjectY(44, 4) = -50
- iObjectZ(44, 4) = -50
- 'Vertex 5:
- iObjectX(44, 5) = 50
- iObjectY(44, 5) = 50
- iObjectZ(44, 5) = 50
- 'Vertex 6:
- iObjectX(44, 6) = -50
- iObjectY(44, 6) = 50
- iObjectZ(44, 6) = 50
- 'Vertex 7:
- iObjectX(44, 7) = -50
- iObjectY(44, 7) = -50
- iObjectZ(44, 7) = 50
- 'Vertex 8:
- iObjectX(44, 8) = 50
- iObjectY(44, 8) = -50
- iObjectZ(44, 8) = 50
- End Sub
- Sub MinusButton_Click ()
- BackForScroll.value = BackForScroll.value + 1
- End Sub
- Sub PanLRScroll_Change ()
- If iFlatLined Then Exit Sub
- If PanLRScroll.value = 181 Then PanLRScroll.value = -180
- If PanLRScroll.value = -181 Then PanLRScroll.value = 180
- sfAzimuth = PanLRScroll.value * sfPi / 180
- Label4.caption = " Azimuth = " + Str$(PanLRScroll.value)
- DeltaLR% = iOldLRAngle - PanLRScroll.value
- DeltaAzimuth# = DeltaLR% * sfPi / 180
- Tx# = sfViewPointX
- Ty# = sfViewPointY + 100
- Tz# = sfViewPointZ
- 'Convert single-precision parameters to double precision for call to DLL:
- a# = sfViewPointX
- b# = sfViewPointY
- c# = sfViewPointZ
- d# = sfWinPointX
- e# = sfWinPointY
- f# = sfWinPointZ
- g# = sfRPointX
- h# = sfRPointY
- i# = sfRPointZ
- j# = sfSPointX
- k# = sfSPointY
- l# = sfSPointZ
- SolidRotate a#, b#, c#, Tx#, Ty#, Tz#, d#, e#, f#, DeltaAzimuth#
- SolidRotate a#, b#, c#, Tx#, Ty#, Tz#, g#, h#, i#, DeltaAzimuth#
- SolidRotate a#, b#, c#, Tx#, Ty#, Tz#, j#, k#, l#, DeltaAzimuth#
- 'Convert back to single precision:
- sfWinPointX = d#
- sfWinPointY = e#
- sfWinPointZ = f#
- sfRPointX = g#
- sfRPointY = h#
- sfRPointZ = i#
- sfSPointX = j#
- sfSPointY = k#
- sfSPointZ = l#
- iOldLRAngle = PanLRScroll.value
- PlaceAllObjects
- If Abs(sfViewPointX) < 1000 And Abs(sfViewPointY) < 1000 And Abs(sfViewPointZ) < 1000 And StopButton.enabled = 0 Then
- RunButton.enabled = -1
- End If
- ViewPic.SetFocus
- End Sub
- Sub PanUDScroll_Change ()
- If iFlatLined Then Exit Sub
- DeltaUD% = iOldUDAngle - PanUDScroll.value
- DeltaElevation# = DeltaUD% * sfPi / 180
- sfElevation = -PanUDScroll.value * sfPi / 180
- Label5.caption = " Inclination = " + Str$(-PanUDScroll.value)
- Ux# = sfViewPointX + sfRPointX - sfWinPointX
- Uy# = sfViewPointY + sfRPointY - sfWinPointY
- Uz# = sfViewPointZ + sfRPointZ - sfWinPointZ
- 'Convert single-precision parameters to double precision for call to DLL:
- a# = sfViewPointX
- b# = sfViewPointY
- c# = sfViewPointZ
- d# = sfWinPointX
- e# = sfWinPointY
- f# = sfWinPointZ
- g# = sfRPointX
- h# = sfRPointY
- i# = sfRPointZ
- j# = sfSPointX
- k# = sfSPointY
- l# = sfSPointZ
- SolidRotate a#, b#, c#, Ux#, Uy#, Uz#, d#, e#, f#, -DeltaElevation#
- SolidRotate a#, b#, c#, Ux#, Uy#, Uz#, g#, h#, i#, -DeltaElevation#
- SolidRotate a#, b#, c#, Ux#, Uy#, Uz#, j#, k#, l#, -DeltaElevation#
- 'Convert back to single precision:
- sfWinPointX = d#
- sfWinPointY = e#
- sfWinPointZ = f#
- sfRPointX = g#
- sfRPointY = h#
- sfRPointZ = i#
- sfSPointX = j#
- sfSPointY = k#
- sfSPointZ = l#
- iOldUDAngle = PanUDScroll.value
- PlaceAllObjects
- If Abs(sfViewPointX) < 1000 And Abs(sfViewPointY) < 1000 And Abs(sfViewPointZ) < 1000 And StopButton.enabled = 0 Then
- RunButton.enabled = -1
- End If
- ViewPic.SetFocus
- End Sub
- Sub PlusButton_Click ()
- BackForScroll.value = BackForScroll.value - 1
- End Sub
- Sub Pyramids ()
- 'This sub defines the pyramids as aggregates of filled triangles and squares:
- i% = iNumObjects
- 'First Pyramid:
- i% = i% + 1
- iObjectType(i%) = 22 'Triangle +X, +Z
- iLocationX(i%) = 10
- iLocationY(i%) = 0
- iLocationZ(i%) = -500 + 10
- iColor(i%) = 6 'Fill color, edges will be black
- sfSize(i%) = 1
- i% = i% + 1
- iObjectType(i%) = 23 'Triangle -X, +Z
- iLocationX(i%) = -10
- iLocationY(i%) = 0
- iLocationZ(i%) = -500 + 10
- iColor(i%) = 6 'Fill color, edges will be black
- sfSize(i%) = 1
- i% = i% + 1
- iObjectType(i%) = 24 'Triangle -X, -Z
- iLocationX(i%) = -10
- iLocationY(i%) = 0
- iLocationZ(i%) = -500 - 10
- iColor(i%) = 6 'Fill color, edges will be black
- sfSize(i%) = 1
- i% = i% + 1
- iObjectType(i%) = 25 'Triangle +X, -Z
- iLocationX(i%) = 10
- iLocationY(i%) = 0
- iLocationZ(i%) = -500 - 10
- iColor(i%) = 6 'Fill color, edges will be black
- sfSize(i%) = 1
- i% = i% + 1
- iObjectType(i%) = 26 'Pyramid base
- iLocationX(i%) = 0
- iLocationY(i%) = -50 'set below the apex
- iLocationZ(i%) = -500
- iColor(i%) = 6 'Fill color, edges will be black
- sfSize(i%) = 1
- 'Second Pyramid:
- i% = i% + 1
- iObjectType(i%) = 22 'Triangle +X, +Z
- iLocationX(i%) = 7 - 100
- iLocationY(i%) = 0
- iLocationZ(i%) = -500 + 7 - 200
- iColor(i%) = 6 'Fill color, edges will be black
- sfSize(i%) = .7
- i% = i% + 1
- iObjectType(i%) = 23 'Triangle -X, +Z
- iLocationX(i%) = -7 - 100
- iLocationY(i%) = 0
- iLocationZ(i%) = -500 + 7 - 200
- iColor(i%) = 6 'Fill color, edges will be black
- sfSize(i%) = .7
- i% = i% + 1
- iObjectType(i%) = 24 'Triangle -X, -Z
- iLocationX(i%) = -7 - 100
- iLocationY(i%) = 0
- iLocationZ(i%) = -500 - 7 - 200
- iColor(i%) = 6 'Fill color, edges will be black
- sfSize(i%) = .7
- i% = i% + 1
- iObjectType(i%) = 25 'Triangle +X, -Z
- iLocationX(i%) = 7 - 100
- iLocationY(i%) = 0
- iLocationZ(i%) = -500 - 7 - 200
- iColor(i%) = 6 'Fill color, edges will be black
- sfSize(i%) = .7
- i% = i% + 1
- iObjectType(i%) = 26 'Pyramid base
- iLocationX(i%) = -100
- iLocationY(i%) = -35 'set below the apex
- iLocationZ(i%) = -500 - 200
- iColor(i%) = 6 'Fill color, edges will be black
- sfSize(i%) = .7
- iNumObjects = i%
- End Sub
- Sub RelativeX_Click ()
- LocOK% = -1
- msg$ = "What is the X distance to jump:"
- Result$ = InputBox$(msg$, "Relative X Coordinate", "0")
- If Result$ = "" Then Exit Sub
- Delta! = Val(Result$)
- sfViewPointX = sfViewPointX + Delta!
- sfWinPointX = sfWinPointX + Delta!
- sfRPointX = sfRPointX + Delta!
- sfSPointX = sfSPointX + Delta!
- LocationModes 0, LocOK%
- If LocOK% = 86 Then 'Trying to jump to a forbidden zone
- sfViewPointX = sfViewPointX - Delta!
- sfWinPointX = sfWinPointX - Delta!
- sfRPointX = sfRPointX - Delta!
- sfSPointX = sfSPointX - Delta!
- Exit Sub
- End If
- Label1.caption = " X = " + Format$(sfViewPointX, "####0")
- PlaceAllObjects
- End Sub
- Sub RelativeY_Click ()
- LocOK% = -1
- msg$ = "What is the Y distance to jump:"
- Result$ = InputBox$(msg$, "Relative Y Coordinate", "0")
- If Result$ = "" Then Exit Sub
- Delta! = Val(Result$)
- sfViewPointY = sfViewPointY + Delta!
- sfWinPointY = sfWinPointY + Delta!
- sfRPointY = sfRPointY + Delta!
- sfSPointY = sfSPointY + Delta!
- LocationModes 0, LocOK%
- If LocOK% = 86 Then 'Trying to jump to a forbidden zone
- sfViewPointY = sfViewPointY - Delta!
- sfWinPointY = sfWinPointY - Delta!
- sfRPointY = sfRPointY - Delta!
- sfSPointY = sfSPointY - Delta!
- Exit Sub
- End If
- Label2.caption = " Y = " + Format$(sfViewPointY, "####0")
- PlaceAllObjects
- End Sub
- Sub RelativeZ_Click ()
- LocOK% = -1
- msg$ = "What is the Z distance to jump:"
- Result$ = InputBox$(msg$, "Relative Z Coordinate", "0")
- If Result$ = "" Then Exit Sub
- Delta! = Val(Result$)
- sfViewPointZ = sfViewPointZ + Delta!
- sfWinPointZ = sfWinPointZ + Delta!
- sfRPointZ = sfRPointZ + Delta!
- sfSPointZ = sfSPointZ + Delta!
- LocationModes 0, LocOK%
- If LocOK% = 86 Then 'Trying to jump to a forbidden zone
- sfViewPointZ = sfViewPointZ - Delta!
- sfWinPointZ = sfWinPointZ - Delta!
- sfRPointZ = sfRPointZ - Delta!
- sfSPointZ = sfSPointZ - Delta!
- Exit Sub
- End If
- Label2.caption = " Z = " + Format$(sfViewPointZ, "####0")
- PlaceAllObjects
- End Sub
- Sub SCCheck_Click ()
- If SCCheck.value = 1 Then SpinCube
- End Sub
- Sub SpinningCube ()
- i% = iNumObjects
- i% = i% + 1
- iObjectType(i%) = 44 'WireFrame Cube
- iLocationX(i%) = -3000
- iLocationY(i%) = 1000
- iLocationZ(i%) = 0
- iColor(i%) = 1
- sfSize(i%) = 2
- 'Spinning Cube object number for location change in Timer event:
- iSCNum = i%
- iNumObjects = i%
- End Sub
- Sub ViewAboutFace_Click ()
- If ViewABoutFace.checked = 0 Then
- AFButton.Visible = -1
- ViewABoutFace.checked = -1
- msg$ = "Use the 'About Face' button to rotate to look behind you."
- CommText.text = msg$
- Else
- AFButton.Visible = 0
- ViewABoutFace.checked = 0
- End If
- End Sub
- Sub ViewFine_Click ()
- If ViewFine.checked = 0 Then
- PlusButton.Visible = -1
- MinusButton.Visible = -1
- ViewFine.checked = -1
- msg$ = "Use the fine position controls to move to an exact point in cyberspace."
- msg$ = msg$ + " The '+1' button will move you forward one Cyberspace Linear"
- msg$ = msg$ + " Unit (CLU). The '-1' button will move you backward one CLU."
- CommText.text = msg$
- Else
- PlusButton.Visible = 0
- MinusButton.Visible = 0
- ViewFine.checked = 0
- End If
- End Sub
- Sub ViewPic_DblClick ()
- DeltaVert% = CInt(sfMDownY * 25 / 500)
- PanUDScroll.value = PanUDScroll.value - DeltaVert%
- DeltaHort% = CInt(sfMDownX * 25 / 500)
- NewHort% = PanLRScroll.value + DeltaHort%
- If NewHort% > 180 Then NewHort% = NewHort% - 360
- If NewHort% < -180 Then NewHort% = NewHort% + 360
- PanLRScroll.value = NewHort%
- End Sub
- Sub ViewPic_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
- sfMDownX = X
- sfMDownY = Y
- End Sub
- Sub YellowCluster ()
- i% = iNumObjects + 1
- iObjectType(i%) = 43 'Globular cluster
- iLocationX(i%) = 0
- iLocationY(i%) = 5000
- iLocationZ(i%) = 0
- iColor(i%) = 14 'QBcolor
- sfSize(i%) = 2
- iNumObjects = i%
- End Sub
-